import { StyleSheet, Text, View } from 'react-native'
import React, { useState } from 'react'
import { SearchIcon, Input } from 'native-base'

const Search = (props) => {
  const { defaultValue = '' } = props
  const [value, setValue] = useState(defaultValue)
  return (
    <View style={styles.box}>
      <Input placeholder="请输入标题关键词" variant="filled" width="100%" borderRadius="10" py="1" px="2" borderWidth="0"
        InputLeftElement={<SearchIcon />}
        onChangeText={text => setValue(text)}
        value={value}
        {...props}
      />
    </View>
  )
}

export default Search

const styles = StyleSheet.create({
  box: {
    width: '90%'
  }
})